--- /dev/null
+/* Revealer
+ *
+ * GtkRevealer is a container that animates showing and hiding
+ * of its sole child with nice transitions.
+ */
+
+#include <gtk/gtk.h>
+
+static GtkBuilder *builder;
+static gint count = 0;
+
+static void
+change_direction (GtkRevealer *revealer)
+{
+ gboolean revealed;
+
+ revealed = gtk_revealer_get_child_revealed (revealer);
+ gtk_revealer_set_reveal_child (revealer, !revealed);
+}
+
+static gboolean
+reveal_one (gpointer data)
+{
+ gchar *name;
+ GtkRevealer *revealer;
+
+ name = g_strdup_printf ("revealer%d", count);
+ revealer = (GtkRevealer *)gtk_builder_get_object (builder, name);
+
+ gtk_revealer_set_reveal_child (revealer, TRUE);
+
+ g_signal_connect (revealer, "notify::child-revealed",
+ G_CALLBACK (change_direction), NULL);
+ count++;
+
+ return count < 9;
+}
+
+static void
+response_cb (GtkWidget *dialog,
+ gint response_id,
+ gpointer data)
+{
+ gtk_widget_destroy (dialog);
+}
+
+GtkWidget *
+do_revealer (GtkWidget *do_widget)
+{
+ static GtkWidget *window = NULL;
+ GError *err = NULL;
+
+ if (!window)
+ {
+ builder = gtk_builder_new ();
+ gtk_builder_add_from_resource (builder, "/revealer/revealer.ui", &err);
+ if (err)
+ {
+ g_error ("ERROR: %s\n", err->message);
+ return NULL;
+ }
+ gtk_builder_connect_signals (builder, NULL);
+ window = GTK_WIDGET (gtk_builder_get_object (builder, "dialog1"));
+ gtk_window_set_screen (GTK_WINDOW (window),
+ gtk_widget_get_screen (do_widget));
+ g_signal_connect (window, "destroy",
+ G_CALLBACK (gtk_widget_destroyed), &window);
+ g_signal_connect (window, "response", G_CALLBACK (response_cb), NULL);
+ }
+
+ if (!gtk_widget_get_visible (window))
+ {
+ count = 0;
+ g_timeout_add (690, reveal_one, NULL);
+ gtk_widget_show_all (window);
+ }
+ else
+ {
+ gtk_widget_destroy (window);
+ window = NULL;
+ }
+
+
+ return window;
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.6 -->
+ <object class="GtkDialog" id="dialog1">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="type_hint">dialog</property>
+ <property name="default_width">300</property>
+ <property name="default_height">300</property>
+ <property name="title">Revealer</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button1">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkRevealer" id="revealer0">
+ <property name="visible">True</property>
+ <property name="transition-duration">2000</property>
+ <property name="transition-type">crossfade</property>
+ <child>
+ <object class="GtkImage" id="image0">
+ <property name="visible">True</property>
+ <property name="icon-name">face-cool-symbolic</property>
+ <property name="icon-size">6</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">2</property>
+ <property name="top-attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRevealer" id="revealer1">
+ <property name="visible">True</property>
+ <property name="transition-duration">2000</property>
+ <property name="transition-type">slide-up</property>
+ <child>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="icon-name">face-cool-symbolic</property>
+ <property name="icon-size">6</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">2</property>
+ <property name="top-attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRevealer" id="revealer2">
+ <property name="visible">True</property>
+ <property name="transition-duration">2000</property>
+ <property name="transition-type">slide-right</property>
+ <child>
+ <object class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="icon-name">face-cool-symbolic</property>
+ <property name="icon-size">6</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">3</property>
+ <property name="top-attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRevealer" id="revealer3">
+ <property name="visible">True</property>
+ <property name="transition-duration">2000</property>
+ <property name="transition-type">slide-down</property>
+ <child>
+ <object class="GtkImage" id="image3">
+ <property name="visible">True</property>
+ <property name="icon-name">face-cool-symbolic</property>
+ <property name="icon-size">6</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">2</property>
+ <property name="top-attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRevealer" id="revealer4">
+ <property name="visible">True</property>
+ <property name="transition-duration">2000</property>
+ <property name="transition-type">slide-left</property>
+ <child>
+ <object class="GtkImage" id="image4">
+ <property name="visible">True</property>
+ <property name="icon-name">face-cool-symbolic</property>
+ <property name="icon-size">6</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRevealer" id="revealer5">
+ <property name="visible">True</property>
+ <property name="transition-duration">2000</property>
+ <property name="transition-type">slide-up</property>
+ <child>
+ <object class="GtkImage" id="image5">
+ <property name="visible">True</property>
+ <property name="icon-name">face-cool-symbolic</property>
+ <property name="icon-size">6</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">2</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRevealer" id="revealer6">
+ <property name="visible">True</property>
+ <property name="transition-duration">2000</property>
+ <property name="transition-type">slide-right</property>
+ <child>
+ <object class="GtkImage" id="image6">
+ <property name="visible">True</property>
+ <property name="icon-name">face-cool-symbolic</property>
+ <property name="icon-size">6</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">4</property>
+ <property name="top-attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRevealer" id="revealer7">
+ <property name="visible">True</property>
+ <property name="transition-duration">2000</property>
+ <property name="transition-type">slide-down</property>
+ <child>
+ <object class="GtkImage" id="image7">
+ <property name="visible">True</property>
+ <property name="icon-name">face-cool-symbolic</property>
+ <property name="icon-size">6</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">2</property>
+ <property name="top-attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRevealer" id="revealer8">
+ <property name="visible">True</property>
+ <property name="transition-duration">2000</property>
+ <property name="transition-type">slide-left</property>
+ <child>
+ <object class="GtkImage" id="image8">
+ <property name="visible">True</property>
+ <property name="icon-name">face-cool-symbolic</property>
+ <property name="icon-size">6</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">button1</action-widget>
+ </action-widgets>
+ </object>
+</interface>